package com.example.zluserservice.common.constant;

/**
 * @Author zhenliu（孙凌岳）
 * @Description 用户表缓存常量
 * @Date 2025/6/15 10:35
 * @Version 1.0
 */
public class UserCacheConstant {
    /**
     * 用户信息缓存key
     */
    public static final String USER_LOGIN_CACHE = "user:login";
    /**
     * 检查是否已存在username
     */
    public static final String USER_USERNAME_EXIST = "user:username:exists:";
    /**
     *
     */
    public static final String LOCK_USER_REGISTER = "lock:user:register:";
    /**
     * 基于redis自增序列的日志id的key
     */
    public static final String OPERATION_LOG_ID_GENERATOR = "log:id:generator";

    /**
     * 缓存用户id列表
     */
    public static final String USER_DATA_SCOPE_LIST = "user:data_scope:id_list";
    /**
     * 缓存父包
     */
    public static final String PREFIX = "user:";

    /**
     * 缓存父包
     */
    public static final String BASIC = PREFIX + "basic";

    /**
     * 分布式锁前缀
     */
    public static final String LOCK_PREFIX = PREFIX + "lock";

    /**
     * page分页
     */
    public static final String PAGE = PREFIX + "page";

    /**
     * list下拉框
     */
    public static final String LIST = PREFIX + "list";

    /**
     * 用户登录
     */
    public static final String LOGIN = PREFIX + "login";

    /**
     * 用户与会话之间的唯一标识，用于限制只有一个会话登录
     */
    public static final String USER_TOKEN = PREFIX + "token:user-token";

    /**
     * 会话与jwtToken之间的唯一标识，用于令牌续期
     */
    public static final String JWT_TOKEN = PREFIX + "token:jwt-token";

    /**
     * 用户ID生成器
     */
    public static final String USERS_SHARD_KEY_ID_GENERATOR = "user:shard_key:generator";
}
